package st.business.tepth.business.taskallocation.detail;

import java.util.List;

import io.reactivex.disposables.Disposable;
import st.business.tepth.base.OnDataConvertListener;
import st.shadow.library.core.base.mvp.BaseModel;
import st.shadow.library.core.base.mvp.BasePresenter;
import st.shadow.library.core.base.mvp.BaseView;
import st.shadow.library.ui.recycler.MultipleItemEntity;

/**
 * Author: shadow
 * Email:  1025431817@qq.com
 * Time:   2019-02-26 11:59
 */

public interface AllocationDetailContract {
    interface View extends BaseView {
        void showTaskList(List<MultipleItemEntity> list);

        void showError(String msg);

        void showAllocationSucceed();

        void cancelAllocateSucceed(int position);
    }

    interface Model extends BaseModel {
        Disposable allocationTasks(String token, int repairId, String repairTaskList,
                                   OnDataConvertListener<String> listener);

        Disposable getTaskList(String token, int repairId,
                               OnDataConvertListener<List<MultipleItemEntity>> listener);

        Disposable cancelAllocate(String token, int repairTaskId,
                                     int userId, OnDataConvertListener<String> listener);
    }

    abstract class Presenter extends BasePresenter<View> {
        abstract void allocationTasks(String token, int repairId, String repairTaskList);

        abstract void getTaskList(String token, int repairId);

        abstract void cancelAllocate(String token, int repairTaskId, int userId, int position);
    }
}
